package com.example.zhihuhelpapp.mvp;

import com.example.zhihuhelpapp.api.MySubscribe;
import com.example.zhihuhelpapp.api.RetrofitManager;
import com.example.zhihuhelpapp.api.mvp.RxPresenter;
import com.example.zhihuhelpapp.bean.QuestionResultBean;
import com.example.zhihuhelpapp.mvp.contract.IUserAnswerListContract;
import com.example.zhihuhelpapp.utils.CoreConstant;
import com.example.zhihuhelpapp.utils.LogUtils;

import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

public class UserAnswerListPresenter extends RxPresenter<IUserAnswerListContract.IView>
        implements IUserAnswerListContract.IPresenter{
    public void getUserAnswerList(String userId){
        RetrofitManager.getInstance()
                .apiService()
                .getUserAnswerList(userId,20,0)
                .compose(mView.<Object>bind())
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new MySubscribe<Object>() {
                    @Override
                    public void onNext(Object resultBean) {

                    }

                    @Override
                    public void onError(Throwable e) {
                        super.onError(e);
                        LogUtils.i("获取用户问题列表出错：" + e.getMessage());
                    }
                });
    }
}
